import request from '@/utils/request'

// 查询策略设备关联列表
export function listStrategyDevice(query) {
  return request({
    url: '/manage/strategyDevice/list',
    method: 'get',
    params: query
  })
}

// 根据策略ID查询设备关联列表
export function getStrategyDeviceByStrategyId(strategyId) {
  return request({
    url: '/manage/strategyDevice/strategy/' + strategyId,
    method: 'get'
  })
}

// 根据设备ID查询策略关联列表
export function getStrategyDeviceByDeviceId(deviceId) {
  return request({
    url: '/manage/strategyDevice/device/' + deviceId,
    method: 'get'
  })
}

// 查询策略设备关联详细
export function getStrategyDevice(id) {
  return request({
    url: '/manage/strategyDevice/' + id,
    method: 'get'
  })
}

// 新增策略设备关联
export function addStrategyDevice(data) {
  return request({
    url: '/manage/strategyDevice',
    method: 'post',
    data: data
  })
}

// 修改策略设备关联
export function updateStrategyDevice(data) {
  return request({
    url: '/manage/strategyDevice',
    method: 'put',
    data: data
  })
}

// 删除策略设备关联
export function delStrategyDevice(id) {
  return request({
    url: '/manage/strategyDevice/' + id,
    method: 'delete'
  })
}

// 导出策略设备关联
export function exportStrategyDevice(query) {
  return request({
    url: '/manage/strategyDevice/export',
    method: 'post',
    data: query
  })
}